package org.omg.IOP;

/**
 * Generated from IDL definition of struct "TaggedComponent"
 * 
 * @author IDL compiler
 */

public class TaggedComponentHelper {
	// private static org.omg.CORBA.TypeCode _type =
	// org.omg.CORBA.ORB.init().create_struct_tc(org.omg.IOP.TaggedComponentHelper.id(),"TaggedComponent",new
	// org.omg.CORBA.StructMember[]{new
	// org.omg.CORBA.StructMember("tag",org.omg.CORBA.ORB.init().create_alias_tc(
	// org.omg.IOP.ComponentIdHelper.id(),"ComponentId",org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(5))),null),new
	// org.omg.CORBA.StructMember("component_data",org.omg.CORBA.ORB.init().create_sequence_tc(0,
	// org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(10))),null)});
	private static org.omg.CORBA.TypeCode _type;

	public TaggedComponentHelper() {
	}

	public static void insert(org.omg.CORBA.Any any,
			org.omg.IOP.TaggedComponent s) {
		any.type(type());
		write(any.create_output_stream(), s);
	}

	public static org.omg.IOP.TaggedComponent extract(org.omg.CORBA.Any any) {
		return read(any.create_input_stream());
	}

	public static org.omg.CORBA.TypeCode type() {
		return _type;
	}

	public static String id() {
		return "IDL:omg.org/IOP/TaggedComponent:1.0";
	}

	public static org.omg.IOP.TaggedComponent read(
			org.omg.CORBA.portable.InputStream in) {
		org.omg.IOP.TaggedComponent result = new org.omg.IOP.TaggedComponent();
		result.tag = in.read_ulong();
		int _lresult_component_data2 = in.read_long();
		result.component_data = new byte[_lresult_component_data2];
		in.read_octet_array(result.component_data, 0, _lresult_component_data2);
		return result;
	}

	public static void write(org.omg.CORBA.portable.OutputStream out,
			org.omg.IOP.TaggedComponent s) {
		out.write_ulong(s.tag);

		out.write_long(s.component_data.length);
		out.write_octet_array(s.component_data, 0, s.component_data.length);
	}
}
